package duilibhx.utils;
import cpp.Lib;
import duilibhx.ui.Control;

/**
 * ...
 * @author wangjian QQ:421924396
 */

class DialogBuilder 
{
	private var duilib_handle:Dynamic;
	public function new() 
	{
		duilib_handle=dui_dialogbuilder_new(this);
	}
	public function create(xmlPath:String, _pm:PaintManager, ?type:Int = 0, ?_parent:Control = null):Control {
		 var controlUI:Control = untyped new Control(dui_dialogbuilder_create(duilib_handle, xmlPath, _pm == null?null: _pm.duilib_handle, type, _parent == null?null:_parent.duilib_handle));
		untyped controlUI.registerHxObj();
		return controlUI;
	}
	static var dui_dialogbuilder_new = Lib.load("DuiLib", "dui_dialogbuilder_new", 1);
	static var dui_dialogbuilder_create = Lib.load("DuiLib", "dui_dialogbuilder_create", 5);
}

/*
CDialogBuilder();
    CControlUI* Create(STRINGorID xml, LPCTSTR type = NULL, IDialogBuilderCallback* pCallback = NULL,
        CPaintManagerUI* pManager = NULL, CControlUI* pParent = NULL);
    CControlUI* Create(IDialogBuilderCallback* pCallback = NULL, CPaintManagerUI* pManager = NULL,
        CControlUI* pParent = NULL);

    CMarkup* GetMarkup();

    void GetLastErrorMessage(LPTSTR pstrMessage, SIZE_T cchMax) const;
    void GetLastErrorLocation(LPTSTR pstrSource, SIZE_T cchMax) const;


*/